Brief Full Advanced Search Search Tips
|  |  | To access the contents, click the chapter and section titles. Visual Basic 6 Programming Blue Book: The Most Complete, Hands-On Resource for Writing Programs with Microsoft Visual Basic 6! (Publisher: The Coriolis Group) Author(s): Peter G. Aitken ISBN: 1576102815 Publication Date: 08/01/98 Search this book:
Previous | Table of Contents | Next
## Part 1 Programming The Visual Basic Way ## Chapter 1 RAD, Baby Visual Basic is the leader of the pack when it comes to rapid application development. RAD used to stand for radical, but in today’s “I need it yesterday” world of computer programming, it means rapid application development. There’s an ever-expanding need for speedy development of applications programs that are sophisticated, reliable, and full-featured. Visual Basic was the first RAD tool for the Windows operating system, and to many people it is still the best. With Visual Basic, you will be surprised at the speed and ease with which you can create real programs. Whether you are programming for yourself, your boss, or a paying client, Visual Basic is the best tool for getting the results you need when you need them. Getting the most out of Visual Basic requires some knowledge and effort on your part. That’s the purpose of this book—to help you along the path to becoming a skilled Visual Basic programmer. The information you need to work effectively can be divided into two areas. First, of course, are the unavoidable details of using the Visual Basic development environment, writing Basic code, and so on. Most of the book is devoted to explaining the details. Equally important as the details, however, is a general overview of how Visual Basic works—how a program is put together, how the various parts of a program talk to each other, and how a program interacts with the user. With a good comprehension of the overall Visual Basic framework, you’ll find the details a lot easier to learn and under-stand. This is true whether you are totally new to programming or have some previous experience. In the first few chapters, my main goal is to help you develop this overall understanding of how Visual Basic works. We will also start learning some of the details and see how to use the Visual Basic development environment. ### Put On Your Thinking Cap To understand how Visual Basic works, sit back for a moment and think about the various Windows programs you have used. The type of program—word processor, Web browser, home finance organizer—doesn’t matter. Then, complete the following sentence: Windows programs __________________. Did you come up with an answer? What I was looking for is have a lot in common. At first, you may think that this is a strange way to complete the sentence. How can I say that your graphics program has a lot in common with the software you use to track your investments? Sure, they are different in many ways, but they also have plenty of similarities. For example, they all have screen windows that can be resized, moved, minimized, and so on. (Why do you think they call the operating system Windows?) They also have a subset of the same fundamental components: pull-down menus, option buttons that can be turned on or off, command buttons that carry out an action when clicked, text boxes for display and entry of text, and so forth. The list goes on and on, but the conclusion is clear: To a large extent, Windows programs consist of the same components combined in different ways. The original release of Visual Basic was the first development tool that recognized this fact and made use of it to make the programmer’s life easier. Rather than making you create your own components each and every time your program needs one, Visual Basic provides a toolbox of predefined components that are thoroughly tested and ready to use. Need an option button or a text box? All you need to do is grab one from the toolbox and drop it into your program. Now let’s go a step further and ask what these components do. The specific tasks vary from one program to the next, of course, so consider this question at a more fundamental level. A menu drops down when its title is clicked, a text box permits text entry and editing, an option button switches between on and off when selected. Again, I could go on and on, but the point is made: Windows components respond to the user. Putting these two insights together, we see that a significant part of any Windows program consists of these “responsive components”—that is, the fundamental Windows objects through which information passes from the user to the program and from the program to the user. And that’s the genius of Visual Basic—providing these responsive components and making it easy for you to put them together to obtain whatever functionality you need in your program. TIP: Get Familiar With Windows Before launching our Visual Basic adventure, you should have a decent understanding of Windows applications and of the Windows operating system itself. I’m not talking about programming or being an expert. I’m saying only that you need some experience—if only a couple of hours worth—using Windows programs. Which programs you use doesn’t really matter, because the objective is gaining a feel for the commonalities among Windows programs. Knowing what has been done in existing Windows programs is one of the best ways to get an idea of what you can do in your own programs using Visual Basic. The sample programs supplied with Windows are excellent choices—the games and the Paint program, for example. Because you’ll be using Visual Basic to create Windows programs, you want to have some idea of what the end product will be like. ### Maybe It’s Too Easy? Before we continue, I am going to sound a warning. Believe it or not, some people never reach their full potential as programmers because of the sheer simplicity of creating Windows programs using Visual Basic. I am using the term simple in the comparative sense, of course, but as you’ll see, knocking out an attractive, functioning program in Visual Basic is surprisingly easy. In fact, achieving this level of ease was one of the goals behind the development of Visual Basic. After all, programming should be accessible to any reasonably intelligent computer user—not just to the trained professional. Unfortunately, this thinking has created a two-edged sword: Many users obtain only a surface knowledge of Visual Basic, sufficient to create working programs, but not enough to take full advantage of its features and power. This results in wasted time and effort, not to mention programs that don’t perform as well as they could. The situation is similar to the guy who fancies himself “Mr. Fix It” and goes around using his screwdriver as a chisel. We’ll have none of that here. My goal is not only to teach you the nuts and bolts of Visual Basic programming, but also to show you its underlying structure, so you can use those nuts and bolts to your best advantage. When we’re finished, you’ll not only have a full set of chisels and screwdrivers in your toolkit, but you’ll know exactly when and how to use each tool. ### Under the Hood You have probably guessed that a great deal goes on behind the scenes in Visual Basic. You’re absolutely correct, but what exactly is going on, and what is it for? The answer to the second question is easy: It’s for you, the programmer, and the purpose is to make your life easier. But what is this stuff that goes on? Let’s take a look “under the hood.”
Previous | Table of Contents | Next

| Products | Contact Us | About Us | Privacy | Ad Info | Home Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.